<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业3</title>
    <style>
        .title {
            text-align: center;
            margin: 25px auto;
        }

        .list {
            margin: 25px auto;
            border-collapse: collapse;
        }

        th,
        td {
            border: 1px solid #000;
            padding: 15px 30px;
            text-align: center;
        }

        th:first-child,
        th:last-child,
        td:first-child,
        th:last-child {
            padding: 15px 50px;
        }
    </style>
</head>

<body>
    <h2 class="title">2020年12月消费支出</h2>
    <script>
        let money = prompt('请输入银行卡存款数')
        let dian = prompt('请输入本月电费')
        let shui = prompt('请输入本月水费')
        let wang = prompt('请输入本月网费')
        let yumoney = money - dian - shui - wang
        document.write(`
        <table class="list">
        <tr>
            <th>银行卡余额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>银行卡余额</th>
        </tr>
        <tr>
            <td>${money}元</td>
            <td>${dian}元</td>
            <td>${shui}元</td>
            <td>${wang}元</td>
            <td>${yumoney}元</td>
        </tr>
    </table>
            `)
    </script>

</body>

</html>